﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DGM.Objects.General;
using DGM.Objects.Msmq;
using DGM.Objects.SocialMedia.Twitter;
using DGM.Util.Helpers.Msmq;
using DGM.Util.Helpers.Twitter;

namespace DGM.Service.TwitterFirehose
{
	internal class Program
	{
		private static void Main(string[] args)
		{
			Console.WriteLine("Twitter Firehose");
			TwitterStreamHelper.StreamTrack(TickerExtensions.TickerList(), TweetCallback);
			Console.ReadLine();
		}

		private static void TweetCallback(Tweet tweet)
		{
			string messageQueueName = @"TwitterQueue";

			Console.WriteLine(tweet.UserName);
			MsmqManager.SendToQueue(QueueType.Private, messageQueueName, tweet, tweet.UserName);//,"FormatName:DIRECT=OS:24cptl-nstrecke");
		}
	}
}
